home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Yerk 3.64 / Asm source / LoadACodes < prev    next >
Text File  |  1986-03-14  |  2KB  |  58 lines

  1. \ Asm Codes Loader              Reese Warner                  3/85
  2. \  9/11/85 RW Added type26
  3.  
  4. 50 Dictionary codes
  5.  
  6. : BuildCodes    { \ bytecode type objaddr ct -- }
  7.     0 -> ct
  8.     query: topfile drop
  9.     BEGIN
  10.         @word count put: token               \ gets opcode name
  11.         binary @word number drop -> bytecode \ gets bits for opcode
  12.         decimal @word number drop -> type    \ gets type of operation
  13.         type
  14.         CASE
  15.             1 OF heap> type1 ENDOF           \ finishes typing
  16.             2 OF heap> type2 ENDOF
  17.             3 OF heap> type3 ENDOF           \ heap>
  18.             4 OF heap> type4 ENDOF           \ makes object of type n and ptr
  19.             5 OF heap> type5 ENDOF           \ to it is on the stack
  20.             6 OF heap> type6 ENDOF
  21.             7 OF heap> type7 ENDOF
  22.             8 OF heap> type8 ENDOF
  23.             9 OF heap> type9 ENDOF
  24.             10 OF heap> type10 ENDOF
  25.             11 OF heap> type11 ENDOF
  26.             12 OF heap> type12 ENDOF
  27.             13 OF heap> type13 ENDOF
  28.             14 OF heap> type14 ENDOF
  29.             15 OF heap> type15 ENDOF
  30.             16 OF heap> type16 ENDOF
  31.             18 OF heap> type18 ENDOF
  32.             19 OF heap> type19 ENDOF
  33.             20 OF heap> type20 ENDOF
  34.             21 OF heap> type21 ENDOF
  35.             22 OF heap> type22 ENDOF
  36.             23 OF heap> type23 ENDOF
  37.             24 OF heap> type24 ENDOF
  38.             26 OF heap> type26 ENDOF
  39.             27 OF heap> type27 ENDOF
  40.         ENDCASE -> objAddr
  41.         bytecode init: objAddr                \ reads reast of input line
  42.         objAddr token enter: codes
  43.         query: topFile
  44.     UNTIL
  45. ;
  46.  
  47. : LoadCodes { addr len -- }
  48.     new: loadFile addr len name: topFile
  49.     open: topFile                             \ open "AsmCodes"
  50.     0<
  51.     IF
  52.         200 AsmError                          \ check for bad file
  53.     THEN
  54.     buildCodes
  55.     close: topFile drop                       \ close "asmcodes"
  56.     remove: loadFile
  57. ;
  58.